﻿Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Text
Imports System.Xml
Imports System.Reflection


Partial Class 项目


    Public 路线名称 As String
    Public 测段数 As String
    Public 起点概略高程 As String
    Public 测量方式 As String
    Public 测量代号 As String
    Public 施测单位 As String
    Public 施测年代 As String
    Public 等级 As String
    Public 起测点 As String
    Public 结束点 As String
    Public 区段选择 As String
    Public 测段选择 As String
    Public 施测方法 As String
    Public 水准仪编号 As String
    Public 观测者 As String
    Public 记录者 As String
    Public 软件名称 As String
    Public 软件单位 As String
    Public 水准仪型号 As String
    Public 乘常数 As String
    Public 加常数 As String
    Public 测微器分划值 As String
    Public 标尺类型 As String
    Public 标尺常数 As String
    Public 标尺间距 As String
    Public 尺承类型 As String
    Public 记录器型号 As String
    Public 记录器编号 As String
    Public 标尺编号 As String


    Public Property 标尺s As IList(Of 标尺) = New List(Of 标尺)()
    Public Property 仪器s As IList(Of 仪器) = New List(Of 仪器)()
    Public Property 测段 As 测段

    Public Shared Function Paras(xxNode As XmlNode) As 项目

        Dim tmpClass As 项目 = New 项目()
        Dim nameList As XmlAttributeCollection = xxNode.Attributes
        For Each xxattribute As XmlAttribute In nameList

            Try

                Dim tmpType As Type = tmpClass.GetType()
                Dim tmpP As FieldInfo = tmpType.GetField(xxattribute.Name)
                tmpP.SetValue(tmpClass, xxattribute.Value)
            Catch ex As Exception

            End Try

        Next



        Dim childList As XmlNodeList = xxNode.ChildNodes '取得row下的子节点集合   
        For Each xxxNode As XmlNode In childList

            If (xxxNode.Name.Equals("标尺")) Then

                Dim tmp标尺 As 标尺 = 标尺.Paras(xxxNode)
                tmpClass.标尺s.Add(tmp标尺)
                tmp标尺.项目 = tmpClass
            End If


            If (xxxNode.Name.Equals("仪器")) Then

                Dim tmp仪器 As 仪器 = 仪器.Paras(xxxNode)
                tmpClass.仪器s.Add(tmp仪器)
                tmp仪器.项目 = tmpClass
            End If

        Next

        Return tmpClass

    End Function
End Class
